package nuc.soft.A01.jzs.services;

import java.util.ArrayList;

import nuc.soft.A01.jzs.dao.RoleMapper;
import nuc.soft.A01.jzs.model.Role;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class RoleService {

	@Autowired
	private RoleMapper dao;
	
	public int insert(Role Role)
	{
		return dao.insert(Role);
	}
	
	public int update(Role Role)
	{
		return dao.update(Role);
	}
	
	public int delete(Role Role)
	{
		return dao.delete(Role);
	}
	
	public int deleteById(String id)
	{
		return dao.deleteById(id);
	}
	
	public int deleteById(Role Role)
	{
		return dao.deleteById(Role.getId());
	}
	
	public ArrayList<Role>	getAllRole()
	{
		return (ArrayList<Role>) dao.getAllObject();
	}
	
	public Role getARoleById(String id)
	{
		return (Role) dao.getAObjectById(id);
	}
}
